<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>过渡</title>
    <style>
        .box {
            color: #333;
            font-size: 30px;
            background-color: #333;
        }
        
        .box:hover {
            transition-property: background-color;
            transition-duration: 3s;
            transition-timing-function: linear;
            background-color: pink;
        }
        
        .btn {
            width: 100px;
            height: 40px;
            text-align: center;
            line-height: 40px;
            color: #fff;
            border-radius: 5px;
            background-color: #409eff;
            margin-top: 2em;
        }
        
        .btn:hover {
            transition-property: opacity;
            transition-duration: 0.5s;
            opacity: 0.8;
        }
    </style>
</head>

<body>
    <div class="box">hello 过渡！</div>
    <div class="btn">主要按钮</div>
</body>

</html>